(#1)
c0rrupt Offline
Administrator
 
Posts: 192
Join Date: Mar 2010
Location: Canada
Show Top 10 Downloads by Views [module] - 11-07-2010, 06:19 PM

by jomasaco on Sat Jan 23, 2010



Since i include one easy way to disable the module ($enablemod = true the entire table structure must be inside of module.

Code:
    <?php
    /*BEGIN_INFO
    Show the top downloads by views.
    By jomasaco www.stugas-ddl.org.
    END_INFO*/
    if(!defined("WCDDL_GUTS")) exit;
    $enablemod = true; //change to false if you don't want to show
    if($enablemod) {
    $outa = '<table border="0" cellpadding="6" cellspacing="1" width="100%">
    <thead>
    <tr>
    <th colspan="5">Top 10 Downloads</span></th>
    </tr>
    </thead>
    <tbody>
    <tr><td>Type</td><td>Title</td><td>Provider</td><td>Views</td><td>Rating</td></tr>';
    $getit = mysql_query("SELECT id,sid,type,title,views,rating FROM wcddl_downloads WHERE views>0 ORDER BY views DESC LIMIT 0,10"); //change 10 to many you want
    while ($got = mysql_fetch_array($getit)) {
             $site = mysql_query("SELECT name as sname, url as surl from wcddl_sites WHERE id = '".$got['sid']."'");
             $site = mysql_fetch_assoc($site);
             $row = array_merge($site,$got);   
    $outa .= '<tr><td>'.$row['type'].'</td><td>'.$row['title'].'</td><td>'.$row['sname'].'</td><td>'.$row['views'].'</td><td>'.$row['rating'].'</td></tr>';
    }
    $outa .= '</tbody></table>';
    $core->setTemplateVar("top10",$outa);
    }
    ?>
display
Code:
    <?=$core->templateVar("top10")?>


Before doing any edits to your DDL Site always make a BACKUP first.

Bookmarks

Tags
downloads, module, show, top, views

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




Powered by vBulletin


Content Relevant URLs by vBSEO